package com.jiuyuan.controller;

import com.jiuyuan.entity.Menu;
import com.jiuyuan.entity.vo.RespBean;
import com.jiuyuan.service.IAdminService;
import com.jiuyuan.service.IMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jiuyuan
 * @since 2023-02-15
 */
@RestController
@RequestMapping("/system/config")
public class MenuController {
    @Autowired
    IMenuService menuService;

    @GetMapping("/menu")
    @ApiOperation("通过用户id查询菜单")
    public RespBean getMenusByAdminId(){
        List<Menu> menus = menuService.getMenusByAdminId();
        return RespBean.success(menus);
    }

}
